<template>
	<view class="mine-wrap  content-30">
		<view class="article-title">{{art.artTitle}}</view>
		<view class="article-con">
			<rich-text :nodes="art.artContent"></rich-text>
		</view>
	
	</view>
</template>

<script>
	import { api } from '../../utils/api.js'
	export default {
		data() {
			return {
				art: '',
				code: '',
				id: ''
			}
		},
		onLoad(options) {
			if(options.id) {
				this.artDetails(options.id)
			}
			if(options.code) {
				this.getArt(options.code)
			}
		},
		methods: {
			getArt(code) {
				api.getArtByCode({ artCode: code }, res => {
					console.log(res)
					this.art = res
				})
			},
			artDetails(id) {
				api.artDetails({ id }, res => {
					console.log(res)
					this.art = res
				})
			},
		},
		components:{
			
		}
	}
</script>

<style scoped lang="less">
	@import url('../../app.less');
	.article-title{
		.f32;
		height: 100rpx;
		line-height: 100rpx;
		.bb;
		margin-bottom: 30rpx;
	}
	.article-con{
		.f26;
		line-height: 36rpx;
		text-align: justify;
		img{
			width: auto;
			max-width: 100%;
			display: inline-block;
		}
	}
	
</style>
